
<template>
	<!-- 核销中转站 -->
	<view class="myCancelIndex">
		 <view class="Buttons"  @click="goVerifier">开始核销</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
			},
	
			methods: {
				// 核销功能
				goVerifier() {
					// 允许从相机和相册扫码
					uni.scanCode({
						success: (res) => {
							console.log('条码类型：' + res.scanType);
							console.log('条码内容：' + res.result);
							let type = null;
							// type=activity&orderNo=2021092009302647686700
							// 
							let orderNo = "";
				
							if (res.result.indexOf('&') != -1) {
								type = res.result.split('&')[0].split('=')[1];
								orderNo = res.result.split('&')[1].split('=')[1];
								
								
							} else {
								orderNo = res.result.split('=')[1];
								
							}
							if(orderNo){
								
								uni.navigateTo({
									url:`./myCancel?type=${type}&orderNo=${orderNo}`
								})
							}
							
				
						}
					});
				
					// this.
				},
				
			}
	}
	
</script>

<style lang="scss">
	.myCancelIndex{
		width: 100%;
		height: 100vh;
		display: flex;
		justify-content: center;
		align-items: center;
		.Buttons{
			width: 622rpx;
			height: 84rpx;
			line-height:  84rpx;
			opacity: 1;
			background: #f10200;
			border-radius: 12rpx;
			font-size: 32rpx;
			font-family: Source Han Sans CN, Source Han Sans CN-Bold;
			font-weight: 700;
			text-align: CENTER;
			color: #ffffff;
		}
	}
</style>
